<!-- header -->
<div class="form-group clearfix ">
  <div class="form-inline pull-right">
    <input class="form-control" placeholder="文章标题" name="title" [(ngModel)]="searchData">
    <button class="btn btn-default" (click)="search()">搜索</button>
    <button class="btn btn-default" (click)="reset()">重置</button>
  </div>
</div>

<!-- body -->
<div class="table-responsive">
  <table class="table table-hover">
    <thead>
      <tr>
        <th>ID</th>
        <th>标题</th>
        <th>作者</th>
        <th>类型</th>
        <th>摘要</th>
        <th>状态</th>
        <th>创建时间</th>
        <th>更新时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let item of tableData">
        <td>{{item.id}}</td>
        <td title="{{item.title}}" class="omit">{{item.title}}</td>
        <td>{{item.author?.nick_name||''}}</td>
        <td>{{item.category.name}}</td>
        <td class="table-width ">{{item.excerpt}}</td>
        <td>{{item.status}}</td>
        <td>{{item.created_at}}</td>
        <td>{{item.updated_at}}</td>
        <td class="operate">
          <!--<span routerLink="detail/{{item.id}}">详细</span>- -->
          <span routerLink="modify/{{item.id}}">编辑</span>-
          <span (click)="delDialog(item.id)">删除</span>
        </td>
      </tr>
    </tbody>
  </table>
  <div class="text-center">
    <pagination (pageChanged)="pageChanged($event)" [totalItems]="totalItems" [itemsPerPage]="itemsPerPage" [(ngModel)]="currentPage"
                previousText="&lsaquo;" nextText="&rsaquo;" firstText="&laquo;" lastText="&raquo;" [boundaryLinks]="true" class="pagination-sm"></pagination>
  </div>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow" (promptIsShow)="isShow = $event;"></app-notification>

<!-- 是否确认删除 -->
<div class="modal fade" bsModal #deleteModal="bs-modal" tabindex="-1">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title pull-left">确认</h4>
        <button type="button" class="close pull-right" aria-label="Close" (click)="deleteModal.hide()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-center">
        <p>确定删除吗？</p>
      </div>
      <div class="text-right mb20">
        <button class="btn btn-default btn-md-long" type="button" (click)="deleteModal.hide()">取消</button>
        <button class="btn btn-success btn-md-long" type="button" (click)="delArtical()">确定</button>
      </div>
    </div>
  </div>
</div>
